<template>
  <div class="emergency-detail" v-loading="loading">
    <div>
      <e-container>
        <div style="margin:10px 0 0 0">
          <div class="news-info">
            <h3 class="title0" v-text="map.title"></h3>
            <div class="descount">
              <span class="title">分类：<e-select-view module="emergencykind" :value="map.kind" select="id"
                  show="name"></e-select-view></span>
              <span class="title">点击量：{{ map.clicks }}</span>
              <span class="title">添加人：{{ map.admin }}</span>
            </div>
            <div class="content" v-html="map.content">
            </div>
          </div>
        </div>
      </e-container>
    </div>
  </div>
</template>

<style scoped lang="scss">
.emergency-detail {
  .e-container {
    width: 70%;
  }

  .title0 {
    font-family: cursive;
    font-weight: 600;
    font-size: 35px;
    text-align: center;
    border-bottom: 5px double #8c8c8c;
  }

  .title {
    color: #b6b1b1;
    font-size: 18px;
  }

  .content {
    font-family: fangsong;
    margin-top: 3%;
    border-radius: 5px;
    border: 1px solid #ddd;
    overflow: hidden;
    transition: box-shadow 0.3s, background-color 0.3s, color 0.3s;
    text-decoration: none;
    color: inherit;
    //border-right: 3px solid #DCDFE6;
    //border-bottom: 3px solid #DCDFE6;
    position: relative;
    box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.2);
    padding: 4%;
    font-size: 23px;
    margin-bottom: 5%;
    line-height: 155%;

    ::v-deep h3 {
      border-radius: 5px;
      font-family: 'Raleway';
      font-weight: 600;
      font-size: 25px;
      background: #fafafa;
      line-height: 1.1;
      padding: 20px 3% 20px;
      margin: 0 0 10px;
      position: relative;
      text-align: left;
      text-transform: uppercase;
    }

    ::v-deep h4 {
      font-family: 'Raleway';
      font-weight: 700;
      font-size: 25px;
      color: #636363;
      line-height: 1.1;
      padding: 15px 4% 10px;
      margin: 0 0 0px 0;
      position: relative;
      text-align: left;
      text-transform: uppercase;
    }

    ::v-deep p {
      font-size: 20px;
      text-align: left;
      margin: 0;
      position: relative;

      strong {
        margin-left: -4%;
        display: block;
        text-align: left;
        margin-top: 10px;
        font-size: 23px;
        position: relative;

        &::before {
          content: none; // 将冒号的内容置为none
        }
      }
    }

    ::v-deep .imgComment_figure img {
      width: 90%;
    }

    ::v-deep .imgComment_figure .imgComment_content {
      text-align: left;
    }

    ::v-deep li {
      font-size: 19px;
      padding-left: 4%;
    }
  }
}

::v-deep .descount {
  font-family: cursive;
  text-align: center;
  color: #b6b6b6;
}

::v-deep ol {
  font-size: 20px;
  text-align: left;
  margin-top: 0;
  margin-bottom: 10px;
}
</style>
<script>
import api from '@/api';
import { extend } from '@/utils/extend';
export default {
  data() {
    return {
      loading: false,   // 加载
      isFavorite: false, // 是否已经收藏
      map: {
        title: '',
        kind: '',
        photo: '',
        admin: '',
        clicks: '',
        content: '',
        addtime: '',
      },
    }
  },
  props: {
    id: {
      type: [String, Number],
      required: true
    }
  },
  watch: {
    id: {
      handler() {
        this.loadDetail();
      },
      immediate: true
    },
  },
  computed: {},
  methods: {
    loadDetail() {
      if (this.loading) return;
      this.loading = true;
      this.$get(api.emergency.webdetail, {
        id: this.id
      }).then(res => {
        this.loading = false;
        if (res.code == api.code.OK) {
          extend(this, res.data);
        } else {
          this.$message.error(res.msg);
        }
      }).catch(err => {
        this.loading = false;
        this.$message.error(err.message);
      });
    },

  },
  created() { },
  mounted() { },
  destroyed() { }
}
</script>
